Update binstubs (`spring binstub --all`)

Akinori MUSHA 7 years ago
parent
commit
fd5bd093ef
4 changed files with 15 additions and 12 deletions
  1. 3 2
      bin/rails
  2. 3 2
      bin/rake
  3. 3 2
      bin/rspec
  4. 6 6
      bin/spring

+ 3 - 2
bin/rails

@@ -1,7 +1,8 @@
1 1
 #!/usr/bin/env ruby
2 2
 begin
3
-  load File.expand_path("../spring", __FILE__)
4
-rescue LoadError
3
+  load File.expand_path('../spring', __FILE__)
4
+rescue LoadError => e
5
+  raise unless e.message.include?('spring')
5 6
 end
6 7
 APP_PATH = File.expand_path('../../config/application',  __FILE__)
7 8
 require_relative '../config/boot'

+ 3 - 2
bin/rake

@@ -1,7 +1,8 @@
1 1
 #!/usr/bin/env ruby
2 2
 begin
3
-  load File.expand_path("../spring", __FILE__)
4
-rescue LoadError
3
+  load File.expand_path('../spring', __FILE__)
4
+rescue LoadError => e
5
+  raise unless e.message.include?('spring')
5 6
 end
6 7
 require_relative '../config/boot'
7 8
 require 'rake'

+ 3 - 2
bin/rspec

@@ -1,7 +1,8 @@
1 1
 #!/usr/bin/env ruby
2 2
 begin
3
-  load File.expand_path("../spring", __FILE__)
4
-rescue LoadError
3
+  load File.expand_path('../spring', __FILE__)
4
+rescue LoadError => e
5
+  raise unless e.message.include?('spring')
5 6
 end
6 7
 require 'bundler/setup'
7 8
 load Gem.bin_path('rspec-core', 'rspec')

+ 6 - 6
bin/spring

@@ -4,12 +4,12 @@
4 4
 # It gets overwritten when you run the `spring binstub` command.
5 5
 
6 6
 unless defined?(Spring)
7
-  require "rubygems"
8
-  require "bundler"
7
+  require 'rubygems'
8
+  require 'bundler'
9 9
 
10
-  if match = Bundler.default_lockfile.read.match(/^GEM$.*?^    (?:  )*spring \((.*?)\)$.*?^$/m)
11
-    Gem.paths = { "GEM_PATH" => [Bundler.bundle_path.to_s, *Gem.path].uniq }
12
-    gem "spring", match[1]
13
-    require "spring/binstub"
10
+  if (match = Bundler.default_lockfile.read.match(/^GEM$.*?^    (?:  )*spring \((.*?)\)$.*?^$/m))
11
+    Gem.paths = { 'GEM_PATH' => [Bundler.bundle_path.to_s, *Gem.path].uniq.join(Gem.path_separator) }
12
+    gem 'spring', match[1]
13
+    require 'spring/binstub'
14 14
   end
15 15
 end